$(function() {
	var indexPage = function() {
		this.init();
	};
	indexPage.prototype = {
		init: function() {
			this.initData();
			this.bindEvent();
		},
		initData: function() {
			var user = getLocalStorage(STORATE_MANAGER.user);
			if (user) {
				$("#li_login").hide();
				$("#li_logined").show();
				$("#logined_username").html(user.nickname);
			}
			
		},
		bindEvent: function() {
			//登录
			$("#login").on("click", function() {
				//判断				
				var loginli = $("#li_login");
				var loginedli = $("#li_logined");
				var requestData = {
					username: $("#username").val(),
					password: $("#password").val(),
				}
				thisUserApplication.userLogin(requestData, loginli, loginedli);
			});
		},
	};
	var thisPage = new indexPage();
})